package com.cs.study.homework._0205;

import java.util.Scanner;

public class Prime {
    public static void main(String[] args) {
        System.out.println("请输入一个数字：");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if (isPrime(n)){
                count++;
            }
        }
        System.out.println(n);
        System.out.println("count = " + count);
    }

    public static boolean isPrime(int n) {
        for (int i = 2; i <= n - 1; i++) {
            if (n % i == 0) {
                return false;
            }else  {
                return true;
            }
        }
        return true;
    }
}
